﻿using System;
namespace XamlMvp
{
    public class PagePresenter<TView> : Presenter<TView> where TView : IViewPage
    {
        public IHydratorBinder Hydrators { get { return Binders.Hydrators; } }

        public PagePresenter(TView view) : base(view) { }

        public void NavigateTo(string page)
        {
            if (page == null) throw new ArgumentNullException("page");

            View.NavigationService.Navigate(UriFormats.ViewUri(page));
        }
        public void NavigateTo(string noun, string verb)
        {
            if (noun == null) throw new ArgumentNullException("noun");
            if (verb == null) throw new ArgumentNullException("verb");
            
            View.NavigationService.Navigate(UriFormats.NounVerbUri(noun, verb));
        }        

        public void GoBack()
        {
            View.NavigationService.GoBack();
        }
    }
}
